//
//  UserViewController.swift
//  知乎日报
//
//  Created by Ann on 2017/10/12.
//  Copyright © 2017年 Ann. All rights reserved.
//

import UIKit
//Step.6 抽屉式控制器左边的View创建
let userScreenWidth:CGFloat = 270
let userViewBackground:UIColor = UIColor.init(red: 35/255, green: 42/255, blue: 47/255, alpha: 1)
class UserViewController: UIViewController {

    lazy var topView:TopView = TopView()

    lazy var midView:MidTableView = MidTableView()

    lazy var botomView:BottomView = BottomView()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = userViewBackground
         
        
        setupUI()
        
    }
    func setupUI(){
  
         view.addSubview(topView)
         view.addSubview(midView)
         view.addSubview(botomView)
        
         setLayout()
    
    }
    
    func setLayout(){
    
    topView.snp.makeConstraints { (make) in
        make.top.equalTo(self.topLayoutGuide.snp.bottom)
        make.left.equalTo(self.view.snp.left)
        make.height.equalTo(100)
        make.width.equalTo(userScreenWidth)
        
        }
      
    botomView.snp.makeConstraints { (make) in
        make.bottom.equalTo(view.snp.bottom)
        make.left.equalTo(view.snp.left)
        make.width.equalTo(userScreenWidth)
        make.height.equalTo(50)
        }
     midView.snp.makeConstraints { (make) in
        make.top.equalTo(topView.snp.bottom)
        make.bottom.equalTo(botomView.snp.top)
        make.left.equalTo(self.view.snp.left)
        make.width.equalTo(userScreenWidth)
    }
        
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
      
    }
    
 
}
